﻿using UnityEngine;
using System.Collections;

public class PointScript : MonoBehaviour {

	public GUIText text;

	private int currentPoints = 0;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		if (text == null) {
			try {
				text = GameObject.FindWithTag ("PointTextGame").GetComponent<GUIText> () as GUIText;
			} catch {
			}
		} else {
			text.text = "Points: " + currentPoints;
		}
	}

	public void addPoint(){
		currentPoints++;
	}

	public int getCurrentPoints(){
		return currentPoints;
	}

	public void resetPoints(){
		currentPoints = 0;
		text = null;
	}
}
